home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: HELP - malloc
- Date: 29 Mar 1996 17:15:18 GMT
- Organization: OpenVision
- Message-ID: <4jh5r6$d56@spanky.pls.ov.com>
- References: <1996Mar27.143834.6017@leeds.ac.uk>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article 6017@leeds.ac.uk, csyamc@scs.leeds.ac.uk (A M Casey) writes:
- >I pass this character string into a function, defined as
- >
- >ItemName *char
- >
- >and I have already allocated memory (ItemName=malloc(50)) and
- >set it to a value. It gets into the function fine, but when I call
- >another function, passing ItemName to it, the function changes it
- >to become nothing, although I dont see why. The function which is
- >called does use malloc to allocate memory for other strings, but shouldnt
- >change ItemName in any way.
- >
- >Has malloc overwritten my previously defined string or something?
- >
- >
- >PLEASE PLEASE PLEASE help
- >
- >cheers
- >
- >Andy
- >
- >
-
-
- malloc() has been debugged for eons, it is unlikely to cause the problems
- you describe. It is more likely that your code is exceeding the boundaries
- of the memory you have allocated. In the absence of your code, it is
- impossible to say where this is occurring.
-
- Fletcher.Glenn@ov.com
-
-
-